import { createStore } from 'vuex'
// 根据模块路径命名
import { resetPathHump } from '@/utils/common'

const modules: {[x:string]:any} = {}
// 自动导入模块
const requireModels = require.context('./modules', true, /.js|.ts$/)
requireModels.keys().forEach((item) => {
  modules[resetPathHump(item)] = requireModels(item).default
})

export default createStore({
  state: {},
  mutations: {},
  actions: {},
  modules
})
